import { createSlice } from '@reduxjs/toolkit'

const initialState = {
  count: 0,
}

const counterStore = createSlice({
  name: 'counter-store',
  initialState,
  reducers: {
    add(state, action) {
      state.count = state.count + action.payload
    },
  },
})

export default counterStore
